import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/Home',
      component: resolve => require(['../components/Home.vue'], resolve),
      children: [
        {
          path: '/Home/Login',
          component: resolve => require(['../pages/Login.vue'], resolve),
        },
        {
          path: '/Home/Index',
          component: resolve => require(['../pages/Index.vue'], resolve),
        },
        {
          path: '/Home/Section',
          component: resolve => require(['../pages/section/Section.vue'], resolve),
        },
        {
          path: '/Home/Specific',
          component: resolve => require(['../pages/section/Specific.vue'], resolve),
        },
        {
          path: '/Home/GoodTopic',
          component: resolve => require(['../pages/GoodTopic.vue'], resolve),
        },
        {
          path: '/Home/Topic',
          component: resolve => require(['../pages/Topic.vue'], resolve),
          meta: {
            save: true //需要加校检判断的路由
          },
        },
        {
          path: '/Home/Search',
          component: resolve => require(['../pages/Search.vue'], resolve),

        },
        {
          path: '/Home/NewTopic',
          component: resolve => require(['../pages/NewTopic.vue'], resolve),
        },
        {
          path: '/Home/Announce',
          component: resolve => require(['../pages/Announce.vue'], resolve),
        },
        {
          path: '/Home/Help',
          component: resolve => require(['../pages/Help.vue'], resolve),
        },
        {
          path: '/Home/UserTopic',
          component: resolve => require(['../pages/UserTopic.vue'], resolve),
        },
        {
          path: '/Home/User',
          component: resolve => require(['../pages/user/Home.vue'], resolve),
          redirect: '/Home/User/Info',
          children: [
            {
              path: '/Home/User/Info',
              component: resolve => require(['../components/user/Info.vue'], resolve),
            },
            {
              path: '/Home/User/News',
              component: resolve => require(['../components/user/News.vue'], resolve),
            },
            {
              path: '/Home/User/Comment',
              component: resolve => require(['../components/user/Comment.vue'], resolve),
            },
            {
              path: '/Home/User/Topic',
              component: resolve => require(['../components/user/Topic.vue'], resolve),
            },
            {
              path: '/Home/User/Collection',
              component: resolve => require(['../components/user/Collection.vue'], resolve),
            },
            {
              path: '/Home/User/UpdateInfo',
              component: resolve => require(['../components/user/UpdateInfo.vue'], resolve),
            },
            {
              path: '/Home/User/UpdatePass',
              component: resolve => require(['../components/user/UpdatePass.vue'], resolve),
            }
          ]
        },
        {
          path: '/Home/OtherUser',
          component: resolve => require(['../pages/OtherUser.vue'], resolve),
        },
      ]
    },
    {
      path: '/',
      component: resolve => require(['../pages/Login.vue'], resolve),
      redirect: '/Home/Login',
    }
  ]
})
